<!-- 头部 -->
<include file="Public:header" />

<!-- 资料认证  侧边/头部 -->
<include file="Public:zlrz_header" />


            <div style="height: 976px;" class="nav-a-settings" id="navconfig">
                <ul style="top: 0px;">
                    <li data-nav="showI1">
                        <a href="{:U('laoshi/zlrz',array('newcity'=>$city))}">
                            <span class="sp2">
                                &nbsp;
                            </span>
                            资料认证
                        </a>
                    </li>
                    <li data-nav="showI2">
                        <a href="{:U('laoshi/zlrz_head',array('newcity'=>$city))}">
                            <span class="sp3">
                                &nbsp;
                            </span>
                            头像
                        </a>
                    </li>
                    <li data-nav="showI3">
                        <a href="{:U('laoshi/introduce',array('newcity'=>$city))}">
                            <span class="sp4">
                                &nbsp;
                            </span>
                            自我介绍
                        </a>
                    </li>
                    <li data-nav="showI4">
                        <a href="{:U('laoshi/teaching',array('newcity'=>$city))}" class="active">
                            <span class="sp5">
                                &nbsp;
                            </span>
                            授课信息
                        </a>
                    </li>
                    <li data-nav="showI0">
                        <a href="{:U('laoshi/zhanghao',array('newcity'=>$city))}">
                            <span class="sp1">
                                &nbsp;
                            </span>
                            账号及密码
                        </a>
                    </li>
                    <li data-nav="showI0">
                        <a href="{:U('laoshi/bank',array('newcity'=>$city))}">
                            <span class="sp6">
                                &nbsp;
                            </span>
                            绑定银行卡
                        </a>
                    </li>
                </ul>
            </div>
            <div style="height: 976px;" class="wfor365hls">
                <div class="content-a-settings zlrz" id="CoF1">
                <form class="layui-form" method="post">
                    <div class="lrem x-o" id="tab-identitycard">
                        <div class="o0o desc-F60">
                            温馨提示：以下带号的是必填项。私塾教育郑重为您承诺，我们会加密保护您的个人信息。
                        </div>
                        <div class="o0o cLr editing remo_overflow">
                            <span class="skkm">
                                <label class="star" style="width: 128px;">所在区域<font color="#FF0000">(必选)</font>：</label>
                            </span>
                            <div class="T-subject downlist-subject ">
                                <div class="T-subject downlist-subject112">                    
                                    <select name="sk_city" required lay-verify="required" style="width:135px">
                                        <option value="" selected=""> - 选择 {$showke_info.sk_city} - </option>
                                    <?php foreach ($city_quyu as $c) { ?>
                                        <option value="{$c.city_name}">{$c.city_name}</option>
                                    <?php } ?>
                                    </select>
                                </div>
                           </div>
                           <span class="skkm">
                                <label class="star" style="width: 128px;">授课科目<font color="#FF0000">(必选)</font>：</label>
                            </span>
                            <div class="T-subject downlist-subject ">
                                <div class="T-subject downlist-subject112">                    
                                    <select name="subject" required lay-verify="required" style="width:135px">
                                        <option value="" selected=""> - 选择 {$showke_info.subject}- </option>
                                        <?php foreach ($kecheng as $k) { ?>
                                            <option value="{$k.name}">{$k.name}<option>
                                        <?php } ?>
                                    </select>
                                </div>
                           </div>
                        </div>
                        <div class="o0o cLr editing">
                            <span class="title-o0o">
                                <label class="star" style="width: 128px;">授课范围：</label>
                            </span>
                            <div class="input-tips">
                                <input type="text" name="address" required lay-verify="required" placeholder="请填写您可接受的授课地址，例如，地铁十号线附近" class="pub" value="{$showke_info.address}">
                            </div>
                        </div>

                        <div class="o0o cLr editing">
                            <span class="title-o0o"> 
                                <label class="star" style="width: 128px;">最低课时费：</label>
                            </span>
                            <div class="input-tips">
                                <input type="text" name="price" required lay-verify="required" placeholder="请输入您的最低课时费标准 (元/小时)" class="pub" value="{$showke_info.price}">
                            </div>
                        </div>
                        <div class="o0o cLr editing po-re">
                            <span class="title-o0o skkm">
                                <label class="star po-re" style="width: 128px;">授课阶段及年级：<i>(支持多选)</i></label>
                            </span>
                            <div class="fl sel_teach" id="radioArea">
                                <div class="o0o cLr" name="Radioit">
                                    <span class="title-o0o">
                                    <?php foreach ($grade_info as $g) { ?>
                                        <input class="son" type="checkbox" name="grade" value="{$g.gradeid}"<?php if (in_array($g['gradeid'], $grades)) { ?>
                                          checked
                                        <?php } ?>>{$g.grade_name} &nbsp;
                                    <?php } ?>
                                    </span>
                                </div>
                             </div>
                        </div>

                        <div class="o0o cLr editing po-re">
                            <span class="title-o0o skkm">
                                <label class="star po-re" style="width: 128px;">授课方式：<i>(支持多选)</i></label>
                            </span>
                            <div class="fl sel_teach" id="radioArea">
                                <div class="o0o cLr" name="Radioit">
                                    <span class="title-o0o">
                                    <?php foreach ($method_info as $m) { ?>
                                        <input type="checkbox" class="sm_fangshi" name="sm_fangshi" value="{$m.id}"<?php if (in_array($m['id'], $methods)) { ?>
                                          checked
                                        <?php } ?>>{$m.method_name}
                                    <?php } ?>
                                    </span>
                                </div>
                             </div>
                        </div>

                        <div class="o0o cLr editing po-re" style="border-bottom:0;">
                            <span class="title-o0o skkm">
                                <label class="star po-re" style="width: 128px;">授课时间：</label>
                            </span>
                            <table style="clear:both; width:100%;" class="tbhju">
                                <colgroup>
                                    <col width="16%">
                                    <col width="12%">
                                    <col width="12%">
                                    <col width="12%">
                                    <col width="12%">
                                    <col width="12%">
                                    <col width="12%">
                                    <col width="12%">
                                </colgroup>
                                <thead>
                                    <tr id="uinp">
                                        <th style="background: url(__PUBLIC__/home/images/tabledivid.png) no-repeat; cursor:default;">&nbsp;</th>
                                        <th>星期一</th>
                                        <th>星期二</th>
                                        <th>星期三</th>
                                        <th>星期四</th>
                                        <th>星期五</th>
                                        <th>星期六</th>
                                        <th>星期日</th>
                                    </tr>
                                </thead>
                                <tbody id="uMw">
                                    <tr>
                                        <td class="timE">上午</td>
                                        <?php  foreach ($showke_time_sw as $t) { ?>
                                        <td class="sL"><input class="showke_time" type="checkbox" name="sm_shijian" value="{$t.id}"<?php if (in_array($t['id'], $shouke_times)) { ?>
                                          checked
                                        <?php } ?> /></td>
                                        <?php } ?>
                                    </tr>
                                    <tr>
                                        <td class="timE">下午</td>
                                        <?php  foreach ($showke_time_xw as $t) { ?>
                                        <td class="sL"><input class="showke_time" type="checkbox" name="sm_shijian" value="{$t.id}"<?php if (in_array($t['id'], $shouke_times)) { ?>
                                          checked
                                        <?php } ?> /></td>
                                        <?php } ?>
                                    </tr>
                                    <tr>
                                        <td class="timE">晚上</td>
                                        <?php  foreach ($showke_time_ws as $t) { ?>
                                        <td class="sL"><input class="showke_time" type="checkbox" name="sm_shijian" value="{$t.id}"<?php if (in_array($t['id'], $shouke_times)) { ?>
                                          checked
                                        <?php } ?> /></td>
                                        <?php } ?>
                                    </tr>
                                </tbody>
                            </table>
                        </div>

                        <div class="textareas" style="float:right; width:83%;">
                            <div style="position:relative; height:38px;">
                                <div class="editing fr-fixbtn">
                                    <button class="layui-btn layui-btn-warm" lay-filter="*" lay-submit style="position: absolute; right: 8%;background-color: #30c76c;">保存</button>
                                </div>
                            </div>
                        </div>
                </div>
                </form>
            </div>
        </div>
<script type="text/javascript">
    layui.use(['form','layer','layedit' ,'laypage', 'element','upload'], function(){
      var layer = layui.layer
      ,laypage = layui.laypage
      ,layedit = layui.layedit
      ,element = layui.element()
      ,upload = layui.upload
      ,form = layui.form();
      //layer.msg('Hello World');

      //交互
    form.on('submit(*)', function(data){
        //捉到所有被选中的，发异步进行删除
        //授课年级
        var son = new Array();
        var chenked=$(".son:checked").each(function(){
           son.push($(this).val()); 
        })
        data.field.grade = son;
        //上门方式
        var sm_fangshi = new Array();
        var chenked=$(".sm_fangshi:checked").each(function(){
           sm_fangshi.push($(this).val()); 
        })
        data.field.sm_fangshi = sm_fangshi;

        //授课时间
        var sm_shijian = new Array();
        var chenked=$(".showke_time:checked").each(function(){
           sm_shijian.push($(this).val()); 
        })
        data.field.sm_shijian = sm_shijian;
      //console.log(arr);
        $.ajax({
            url: "{:U('laoshi/teaching_add')}",//请求地址
            type: "post",//请求方式
            dataType: "json",//返回数据类型
            data: data.field,//发送的参数
            })
            .done(function(response) {
                  if(response.error==0){
                     layer.msg(response.info ,{icon:5});

                  }else{
                     layer.msg(response.info ,{icon:6});
                     location.reload();

                  }
              })
            .fail(function() {
                alert("ajxs交互失败");
            })  

          return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });   

    });
</script>
</html>